home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 93 / CDMM_93_2.ISO / Project Nomads / nomads_demo_eng.exe / INPUT.TCL < prev    next >
Encoding:
Text File  |  2002-08-01  |  39.4 KB  |  1,153 lines

  1. #-------------------------------------------------------------------------------
  2. #
  3. #   /nomads/scripts/input.tcl
  4. #
  5. #   THE NOMADS INPUT MAPPING
  6. #
  7. #   Wird vom Standard-Demo ben÷tigt und implementiert
  8. #   die Tastatur-Belegung. Dient dem Prototyping des
  9. #   gesamten Input-Handlings.
  10. #
  11. #   Input-Event-Mapping
  12. #   Die Liste der auf dem aktuellen System verfuegbaren
  13. #   Input-Devices findet man unter /sys/share/input,
  14. #   die Liste die Game-Events unter /sys/share/gameevents.
  15. #
  16. #   created:    05-May-99
  17. #   upd.:       23-Jun-99
  18. #               30-Jul-99   floh    auf Inputserver umgestellt
  19. #               05-Nov-99   bernd   Tasten fⁿr neue Befehle und so
  20. #               24-Nov-99   bernd   angefangen das ganze Input Mapping aufzurΣumen
  21. #                                   Jeder "ZUSTAND" bekommt ein komplettes eigenes 
  22. #                                   Input Mapping.
  23. #               26-Nov-99   bernd   Weiter am Input Mapping
  24. #                           floh    + .beginmap/.endmap
  25. #               29-Nov-99   bernd   Merge Conflicte aufgeloest
  26. #               30-Nov-99   bernd   Weiter am InputMapping
  27. #               20-Dec-99   floh    + Inputmapping fuer Konsole toggeln
  28. #                                   + neues Input-Mapping fuer Input-Recording
  29. #               22-Dec-99   floh    + korrekte Input-Modifier angehaengt (.down...)  
  30. #               29-Dec-99   bernd   Diverse Sachen fⁿrs Rausgeben ausgeklammert
  31. #               03-Jan-2000 bernd   Weiter am Input Mapping (Longpressed etc.)
  32. #               14-Jan-2000         Tuning. GAMEPAD-Belegung.
  33. #               20-Jan-2000 bernd   Ich mu▀ beim Umschalten des Inputs (da ja alle JOHNS - egal ob
  34. #                                   Schatten oder Autonom oder der WAHRE JAKOB - die Stateswitch-
  35. #                                   Routinen aufrufen) abfragen, ob ich auch wirklich derr wahre Jakob bin.
  36. #                                   Dafⁿr gibt es die neue Funktion thatsreallyme.
  37. #               21-Jan-2000 bernd   Es gibt jetzt die global Variable    
  38. #                                   current_input, mit der ich mir merke, welches Input-Mapping
  39. #                                   just aktiv ist.
  40. #               24-jan-2000 bernd   Ein paar Meldungen etwas klarer.
  41. #
  42. #               27-Jan-2000 bernd   Spezielle ESCAPE -Aktion, damit ich Menu und watchown uaf Esc mappen kann
  43. #               31-Jan-2000 floh    aufgeraeumt und fehlende Gamepad Belegung
  44. #               02-Feb-2000 bernd   fast/slow
  45. #               22-Mrz-2000 bernd   Save/Load Levelbau 
  46. #               27-Mrz-2000 bernd   Level Loadscreen
  47. #               13-Jun-2000 bernd   DELETE Taste fⁿr LOAD Screen
  48. #               21-Jun-2000 bernd   Falltaste / Reset View Taste umgelegt
  49. #               23-Jun-2000 bernd   SPELL
  50. #               28-Jun-2000 bernd   WATCH FINE SELECTION
  51. #               30-Jun-2000 floh    + Feuer-Taste beim Maennel
  52. #               18-Jul-00   floh    + Gamepad-Feinarbeit (Cancel-Buttons vereinheitlicht)               
  53. #               08-Nov-2000 jeremy  + Level Design Input (sl_input)            
  54. #               08-Nov-2000 jeremy  + source menu_leveldesign.tcl            
  55. #               07-Mar-2001 bernd   CleanUp / 
  56. #               25-May-01   floh    + Viewer weiterschalten auf Num0 (shift
  57. #                                     aktiviert unter Win2k eine "Eingabehilfe"
  58. #               26-May-01   floh    + Main-Input gekillt.
  59. #               05-Jun-01   floh    + auf Joystick-Analog-Input umgestellt
  60. #               30-Oct-01   floh    + Gebaeudekamera abkoppelbar
  61. #               25-Jan-02   floh    + new debug key: f7 -> set maennel booster charges
  62. #               31-Jan-02   floh    + joymouse Support angefangen
  63. #               19-Feb-02   floh    + input_gameend fuer Spieler tot
  64. #               11-Apr-02   basti   + soundeditor auf 'e' gemappt   
  65. #               17-Jun-02   floh    + neue mouseinput mappings
  66. #               20-Jun-02   floh    + neue Tastatur/Mouse-Mappings
  67. #
  68. #   (C) 1999 Bernd Beyreuther
  69. #   (C) COPYRIGHT 2000,2001 RADONLABS GMBH
  70. #-------------------------------------------------------------------------------
  71.  
  72. /sys/servers/input.setlongpressedtime 0.75
  73. set current_input "guimenu_input"
  74.  
  75. # Mittels einer env-Variablen kann man die Maussteuerung ausschalten
  76. # (NONEBULAMOUSE == 1)
  77. set nomouse 0
  78. catch {set nomouse $env(NONEBULAMOUSE)}
  79.  
  80. #===============================================================================
  81. #
  82. #   HELPER ROUTINEN
  83. #
  84. #===============================================================================
  85.  
  86. #-------------------------------------------------------------------------------
  87. #   Mappings, die immer aktiv sein sollten.
  88. #-------------------------------------------------------------------------------
  89. proc global_mappings {} {
  90.     .map  keyb0:f2.down     "script:/sys/servers/menuhandler.showhelpscreen"
  91.     .map  keyb0:f2.up       "script:/sys/servers/menuhandler.hidehelpscreen"
  92.     .map keyb0:f12.down     "script:screenshot"    
  93.     .map  keyb0:f4.down     "script:/sys/servers/console.watch gfx*"
  94.     .map  keyb0:f4.up       "script:/sys/servers/console.unwatch"
  95. }
  96.  
  97. #-------------------------------------------------------------------------------
  98. #   Debug-Mappings
  99. #-------------------------------------------------------------------------------
  100. proc devstation_mappings {} {
  101. global devstation
  102.     if { $devstation } {
  103.         .map  keyb0:f5.down     "script:finishpart"
  104.         .map  keyb0:f6.down     "script:switchviewers"
  105.         .map  keyb0:f7.down     "script:fillboostercharges"
  106.         .map  keyb0:f8.down     "script:clanenergy" 
  107.         .map  keyb0:f3.down     "script:speedswitch"
  108.         .map  keyb0:f11.down    "script:/sys/servers/console.toggle"
  109.         .map  keyb0:c.down      "script:chapterselector"
  110.         .map  keyb0:f9.down     "script:soundeditor"
  111.         .map  keyb0:p.down      "script:zeit"      
  112.         .map  keyb0:t.down      "script:zeitlupe"
  113.         .map  keyb0:z.down      "script:schnell"        
  114.         .map  keyb0:o.down      "script:visualisations"  
  115.         .map  keyb0:bs.down     "script:/sys/servers/comm.showstats"
  116.         .map  keyb0:bs.up       "script:/sys/servers/comm.hidestats"
  117.     }
  118. }
  119.  
  120. #-------------------------------------------------------------------------------
  121. #   normale Move-(Flug-) Mappings
  122. #-------------------------------------------------------------------------------
  123. proc move_mappings {} {
  124.  
  125.     # Richtungen
  126.     .map keyb0:left.pressed     turn_left
  127.     .map keyb0:right.pressed    turn_right
  128.     .map keyb0:up.pressed       move_down
  129.     .map keyb0:down.pressed     move_up
  130.  
  131.     .map keyb0:a.pressed        turn_left
  132.     .map keyb0:d.pressed        turn_right
  133.     .map keyb0:w.pressed        move_down
  134.     .map keyb0:s.pressed        move_up
  135.  
  136.     .map relmouse0:-x           mouse_turn_left
  137.     .map relmouse0:+x           mouse_turn_right
  138.     .map relmouse0:-y           mouse_move_up
  139.     .map relmouse0:+y           mouse_move_down
  140.             
  141.     .map joy0:-x                turn_left
  142.     .map joy0:+x                turn_right
  143.     .map joy0:-y                move_down
  144.     .map joy0:+y                move_up
  145.  
  146.     .map joy0:-abtn.pressed     turn_left
  147.     .map joy0:+abtn.pressed     turn_right
  148.     .map joy0:-bbtn.pressed     move_down
  149.     .map joy0:+bbtn.pressed     move_up
  150.  
  151.     # Gas geben
  152.     .map keyb0:space.pressed        move_forward
  153.     .map joy0:btn3.pressed          move_forward
  154.     .map relmouse0:btn1.pressed     move_forward
  155.  
  156.     # Gas loslassen
  157.     .map keyb0:space.up             "script:resetboost"
  158.     .map joy0:btn3.up               "script:resetboost"
  159.     .map relmouse0:btn1.up          "script:resetboost"
  160. }
  161.  
  162. #-------------------------------------------------------------------------------
  163. #   normale Walk-Mappings
  164. #-------------------------------------------------------------------------------
  165. proc walk_mappings {} {
  166.  
  167.     # richtungen
  168.     .map keyb0:left.pressed    turn_left
  169.     .map keyb0:right.pressed   turn_right
  170.     .map keyb0:up.pressed      walk_forward
  171.     .map keyb0:down.pressed    walk_back
  172.  
  173.     .map keyb0:a.pressed       turn_left
  174.     .map keyb0:d.pressed       turn_right
  175.     .map keyb0:w.pressed       walk_forward
  176.     .map keyb0:s.pressed       walk_back
  177.  
  178.     .map joy0:-x               turn_left
  179.     .map joy0:+x               turn_right
  180.     .map joy0:+y               walk_back
  181.     .map joy0:-y               walk_forward
  182.  
  183.     .map joy0:-abtn.pressed    turn_left
  184.     .map joy0:+abtn.pressed    turn_right
  185.     .map joy0:+bbtn.pressed    walk_back
  186.     .map joy0:-bbtn.pressed    walk_forward
  187.  
  188.     .map relmouse0:-x          mouse_turn_left
  189.     .map relmouse0:+x          mouse_turn_right
  190.  
  191.     # springen
  192.     .map keyb0:space.pressed   move_forward
  193.     .map joy0:btn3.down        move_forward
  194.     .map relmouse0:btn1.down   move_forward
  195.  
  196.     # Gas loslassen
  197.     .map keyb0:space.up        "script:resetboost"
  198.     .map joy0:btn3.up          "script:resetboost"
  199.     .map relmouse0:btn1.down   "script:resetboost"
  200.  
  201.     # vertical camera freelook
  202.     .map relmouse0:-y               mouse_viewer_lookup
  203.     .map relmouse0:+y               mouse_viewer_lookdown
  204. }
  205.  
  206. #-------------------------------------------------------------------------------
  207. #   Trade Mappings, Mappings fuer Trader, Presse, Storage.
  208. #-------------------------------------------------------------------------------
  209. proc trade_mappings {} {
  210.  
  211.     .map  keyb0:esc.down        menu_cancel
  212.     .map  joy0:btn1.down        menu_cancel
  213.     .map  relmouse0:btn1.down   menu_cancel
  214.     .map  relmouse0:btn2.down   menu_cancel
  215.     
  216.     .map  keyb0:return.down     menu_select
  217.     .map  joy0:btn0.down        menu_select
  218.     .map  relmouse0:btn0.down   menu_select
  219.  
  220.     .map  keyb0:shift.down      menu_throwaway
  221.     .map  joy0:btn3.down        menu_throwaway
  222.  
  223.     .map  keyb0:down.down       menu_back
  224.     .map  joy0:+ybtn.down       menu_back
  225.     .map  joy0:+bbtn.down       menu_back
  226.  
  227.     .map  keyb0:right.down      menu_next
  228.     .map  keyb0:d.down          menu_next
  229.     .map  joy0:+xbtn.down       menu_next
  230.     .map  joy0:+abtn.down       menu_next
  231.     .map  relmouse0:-zbtn.down  menu_next
  232.  
  233.     .map  keyb0:left.down       menu_prev
  234.     .map  keyb0:a.down          menu_prev
  235.     .map  joy0:-xbtn.down       menu_prev
  236.     .map  joy0:-abtn.down       menu_prev
  237.     .map  relmouse0:+zbtn.down  menu_prev
  238. }
  239.  
  240. #-------------------------------------------------------------------------------
  241. #   Oeffnet das Ingame-Menue
  242. #-------------------------------------------------------------------------------
  243. proc ingame_menu {} {
  244.  
  245.     if {[/sys/servers/menuhandler.creditsshown] == "false"} {
  246.         if {[/world.iscinematicrunning] == "false"} {
  247.             if {[/sys/servers/menuhandler.menuopen] == "false"} {
  248.             
  249.                 puts "Open ingame menu."
  250.         
  251.                 # open ingame menu
  252.                 if {[/world.isnetsession] == "true"} {
  253.                     /world.unsethandcontrol
  254.                     /sys/servers/menuhandler.openmenu "ingame_multiplayer"
  255.                 } else {
  256.                     /world.pausegame
  257.                     /sys/servers/menuhandler.openmenu "ingame_singleplayer"
  258.                 }
  259.                 /sys/servers/menuhandler.reset
  260.             }   
  261.         } elseif {[/world.iswarpmode] == "false"} {
  262.             puts "Skipping cinematic sequence."
  263.             /world.enterwarpmode
  264.         }
  265.     }
  266. }
  267.  
  268. #-------------------------------------------------------------------------------
  269. #   Ueberspringt die cutscene
  270. #-------------------------------------------------------------------------------
  271. proc skip_cinematic {} {
  272.     if {[/world.iswarpmode] == "false"} {
  273.         puts "Skipping cinematic sequence."
  274.         /world.enterwarpmode
  275.     }
  276. }
  277.  
  278. #-------------------------------------------------------------------------------
  279. #   Oeffnet Menu im Maennel-Stand
  280. #-------------------------------------------------------------------------------
  281. proc switchmode_stand {} {
  282.  
  283.     if {[/world.ispaused] == "false"} {
  284.         set me [[/world.getuserclan].getmaennel]
  285.         $me.setmenuopen true
  286.     }
  287. }
  288.  
  289. #-------------------------------------------------------------------------------
  290. #   FIXME: dieser ueble HACK sollte durch ein normales Input-Mapping ersetzt
  291. #   werden.
  292. #
  293. #   Darf nicht ausgefuehrt werden, wenn game paused ist!
  294. #-------------------------------------------------------------------------------
  295. proc resetboost {} {
  296.     if {[/world.ispaused] == "false"} {
  297.         set userclan [/world.getuserclan]
  298.         set maennel [$userclan.getmaennel]
  299.         $maennel.setboostpressed false
  300.     }
  301. }
  302.  
  303. # --------------------------------------------------------------------------------------
  304. #   Input group:    GUI Menu Keys
  305. #   Description:    The GUI Menu input mapping 
  306. #
  307. #   DOES NOT MODIFY CURRENT INPUT!!!
  308. # --------------------------------------------------------------------------------------
  309. proc guimenu_mappings {} {
  310.     
  311.     # Menu mapping are always active. (see Menu handler)
  312.     .map keyb0:return.up    "guimenu_action"
  313.     .map keyb0:esc.down     "guimenu_cancel"
  314.     .map keyb0:f1.down      "guimenu_cancel"
  315.     .map keyb0:up.down      "guimenu_up"
  316.     .map keyb0:down.down    "guimenu_down"
  317.     .map keyb0:left.down    "guimenu_left"
  318.     .map keyb0:right.down   "guimenu_right"        
  319.     
  320.     # the gamepads x/y pad (can be analog)
  321.     .map joy0:-xbtn.down    "guimenu_left"
  322.     .map joy0:+xbtn.down    "guimenu_right"
  323.     .map joy0:-ybtn.down    "guimenu_up"
  324.     .map joy0:+ybtn.down    "guimenu_down"
  325.  
  326.     .map joy0:-zbtn.down    "guimenu_left"
  327.     .map joy0:+zbtn.down    "guimenu_right"
  328.     .map joy0:-rbtn.down    "guimenu_up"
  329.     .map joy0:+rbtn.down    "guimenu_down"
  330.    
  331.     .map joy0:btn0.up       "guimenu_action"
  332.     .map joy0:btn2.up       "guimenu_cancel"
  333.     
  334.     # these are the digital pad on analog/digital gamepads
  335.     .map joy0:-abtn.down    "guimenu_left"
  336.     .map joy0:+abtn.down    "guimenu_right"
  337.     .map joy0:-bbtn.down    "guimenu_up"
  338.     .map joy0:+bbtn.down    "guimenu_down"
  339. }
  340.  
  341. #-------------------------------------------------------------------------------
  342. #   Leave a possessed vehicle
  343. #-------------------------------------------------------------------------------
  344. proc escape_possessingvehicle {} {
  345.  
  346.     if {[/world.ispaused] != "true"} {
  347.         if {[/world.fastpossessactive] != "false"} {
  348.             set me [[/world.getuserclan].getmaennel]
  349.             if {"null" != $me} {
  350.                 set old [psel]
  351.                 if {"null" != [/world.getviewercarrier]} {                
  352.                     sel [/world.getviewercarrier]
  353.                     leavevehicle
  354.                     sel $old
  355.                 }
  356.                 $me.setpossessingvehicle false
  357.             }
  358.         }
  359.     }
  360. }
  361.  
  362. #-------------------------------------------------------------------------------
  363. #   Leave a possessed building.
  364. #-------------------------------------------------------------------------------
  365. proc escape_possessingbuilding {} {
  366.  
  367.     if {[/world.ispaused] != "true"} {
  368.         if {[/world.fastpossessactive] != "false"} {
  369.     
  370.             set old [psel]
  371.             sel [/world.getviewercarrier]
  372.             leavevehicle
  373.             sel $old
  374.         
  375.             set me [[/world.getuserclan].getmaennel]
  376.             $me.setpossessingbuilding false
  377.         }
  378.     }
  379. }
  380.  
  381. #-------------------------------------------------------------------------------
  382. #  Escape hit while maennel menu open
  383. #-------------------------------------------------------------------------------
  384. proc escape_walkmenu {} {
  385.  
  386.     if {[/world.ispaused] == "false"} {
  387.     
  388.         # close artefact menu. set force cancel flag
  389.         set me [[/world.getuserclan].getmaennel]
  390.         $me.setcancelmenuaction true
  391.         
  392.         # open ingame menu
  393.         ingame_menu
  394.     }
  395. }
  396.  
  397. #-------------------------------------------------------------------------------
  398. #  Escape hit while using artefact.
  399. #-------------------------------------------------------------------------------
  400. proc escape_useartefactwalk {} {
  401.  
  402.     if {[/world.ispaused] == "false"} {
  403.  
  404.         # cancel build action. if anytime cancel build will end in menu state,
  405.         # also cancel menu action, OTHERWISE NOT!
  406.         set me [[/world.getuserclan].getmaennel]
  407.         $me.setcancelbuildaction true
  408.     
  409.         # open ingame menu
  410.         ingame_menu
  411.     }
  412. }
  413.  
  414. #-------------------------------------------------------------------------------
  415. #   Die Kamera-Input-Mappings
  416. #-------------------------------------------------------------------------------
  417. proc camera_mappings {} {
  418.  
  419.     .map  keyb0:bs.down         viewer_cycle
  420.     .map  joy0:btn5.down        viewer_cycle
  421.  
  422.     # nfreeviewer mappings
  423.     .map keyb0:up.pressed           viewer_forward
  424.     .map keyb0:w.pressed            viewer_forward
  425.     .map keyb0:down.pressed         viewer_backward
  426.     .map keyb0:s.pressed            viewer_backward
  427.     .map keyb0:left.pressed         viewer_strafeleft
  428.     .map keyb0:a.pressed            viewer_strafeleft
  429.     .map keyb0:right.pressed        viewer_straferight
  430.     .map keyb0:d.pressed            viewer_straferight
  431.     .map keyb0:space.down           viewer_reset
  432.     .map relmouse0:-x               viewer_left
  433.     .map relmouse0:+x               viewer_right
  434.     .map relmouse0:+y               viewer_down
  435.     .map relmouse0:-y               viewer_up
  436.     .map relmouse0:btn0.pressed     viewer_backward
  437.     .map relmouse0:btn1.pressed     viewer_forward
  438.  
  439.     .map joy0:btn0.pressed      viewer_forward
  440.     .map joy0:btn1.pressed      viewer_backward
  441.  
  442.     .map joy0:-x                viewer_left
  443.     .map joy0:+x                viewer_right
  444.     .map joy0:+y                viewer_down
  445.     .map joy0:-y                viewer_up
  446.  
  447.     # free look mappings
  448.     .map joy0:-z                viewer_lookleft
  449.     .map joy0:+z                viewer_lookright
  450.     .map joy0:-r                viewer_lookup
  451.     .map joy0:+r                viewer_lookdown      
  452.  
  453.     .map keyb0:j.pressed        viewer_lookleft
  454.     .map keyb0:l.pressed        viewer_lookright
  455.     .map keyb0:i.pressed        viewer_lookup
  456.     .map keyb0:k.pressed        viewer_lookdown
  457. }
  458.  
  459.  
  460.  
  461. #==========================================================================
  462. #
  463. #   HIER DIE INPUT MAPPINGS
  464. #
  465. #==========================================================================
  466.  
  467. #--------------------------------------------------------------------------
  468. # Initiales Input-Mapping beim Spielstart
  469. #
  470. #   *** ACHTUNG ***
  471. #
  472. #   NICHT DIE DEVSTATION MAPPINGS EINFACH HIER REIN!
  473. #--------------------------------------------------------------------------
  474. proc input_guimenu {} {
  475.     set cwd [psel]
  476.     sel /sys/servers/input
  477.     .beginmap
  478.     guimenu_mappings
  479.     camera_mappings
  480.     global_mappings
  481.     .endmap
  482.     sel $cwd
  483. }
  484.  
  485. #--------------------------------------------------------------------------
  486. # Mapping waehrend cinematic
  487. #--------------------------------------------------------------------------
  488. proc input_cutscene {} {
  489.     set cwd [psel]
  490.     sel /sys/servers/input
  491.     .beginmap
  492.     .map  keyb0:esc.down        "script:skip_cinematic"
  493.     .map  joy0:btn5.down        "script:skip_cinematic"
  494.     .endmap
  495.     sel $cwd
  496. }
  497.  
  498. #--------------------------------------------------------------------------
  499. # GAMEEND: Spieler bzw sein Lighthouse ist tot. Auf Tastendruck wird
  500. # die 'loadsavepoint' Routine aus der 'scriptlib.tcl' aufgerufen
  501. #--------------------------------------------------------------------------
  502. proc input_gameend {} {
  503.  
  504.         set cwd [psel]
  505.         sel /sys/servers/input
  506.             .beginmap
  507.  
  508. # FIXME: global_mappings enthaelt Esc->Open Ingame Menu, deshalb auskommentiert
  509. #            global_mappings
  510.             devstation_mappings
  511.             guimenu_mappings
  512.             .endmap
  513.         sel ..
  514.     
  515. }
  516.  
  517. #--------------------------------------------------------------------------
  518. # NORMAL: John fliegt herum
  519. #--------------------------------------------------------------------------
  520. proc input_normal {} {
  521.  
  522.     set cwd [psel]
  523.         sel /sys/servers/input
  524.         .beginmap
  525.         
  526.         global_mappings
  527.         devstation_mappings
  528.         move_mappings
  529.         camera_mappings
  530.         guimenu_mappings
  531.         
  532.         .map keyb0:f1.down      "script:ingame_menu"    
  533.         .map joy0:btn2.down     "script:ingame_menu"
  534.     
  535.         .endmap
  536.     sel $cwd    
  537. }
  538.  
  539. #-------------------------------------------------------------------------------
  540. # LANDEN   Uebergangs-Zustand
  541. #-------------------------------------------------------------------------------
  542. proc input_landen {} {
  543.     set cwd [psel]
  544.         sel /sys/servers/input
  545.         .beginmap
  546.         global_mappings
  547.         devstation_mappings
  548.         walk_mappings
  549.         guimenu_mappings
  550.  
  551.         .map keyb0:f1.down      "script:ingame_menu"    
  552.         .map joy0:btn2.down     "script:ingame_menu"    
  553.  
  554.         .endmap
  555.     sel $cwd        
  556. }
  557.  
  558. #-------------------------------------------------------------------------------
  559. # LANDEN2   sanfterer Landezustand
  560. #-------------------------------------------------------------------------------
  561. proc input_landen2 {} {
  562.  
  563.     set cwd [psel]
  564.         sel /sys/servers/input
  565.         .beginmap
  566.         global_mappings
  567.         devstation_mappings
  568.         walk_mappings
  569.         guimenu_mappings
  570.  
  571.         .map keyb0:f1.down      "script:ingame_menu"    
  572.         .map joy0:btn2.down     "script:ingame_menu"
  573.     
  574.         .endmap
  575.     sel $cwd       
  576. }
  577.  
  578. #-------------------------------------------------------------------------------
  579. # SWIMMING      einfach in der Luft rumhaengen
  580. #-------------------------------------------------------------------------------
  581. proc input_swimming {} {
  582.  
  583.     set cwd [psel]
  584.         sel /sys/servers/input
  585.         .beginmap
  586.         
  587.         global_mappings
  588.         devstation_mappings
  589.         move_mappings
  590.         camera_mappings
  591.         guimenu_mappings
  592.  
  593.         .map keyb0:f1.down      "script:ingame_menu"    
  594.         .map joy0:btn2.down     "script:ingame_menu"
  595.     
  596.         # johnfall(stop) ueberlagern
  597.         .map  keyb0:down.down       "script:johnfall"
  598.         .map  keyb0:down.up         "script:johnfallstop"
  599.         .map  joy0:+ybtn.down       "script:johnfall"
  600.         .map  joy0:+ybtn.up         "script:johnfallstop"
  601.         .map  joy0:+bbtn.down       "script:johnfall"
  602.         .map  joy0:+bbtn.up         "script:johnfallstop"
  603.  
  604.         .endmap
  605.     sel $cwd    
  606. }
  607.  
  608. #-------------------------------------------------------------------------------
  609. # RUN   Input beim Rennen (Stehen ist extra!)
  610. #-------------------------------------------------------------------------------
  611. proc input_run {} {
  612.  
  613.     set cwd [psel]
  614.         sel /sys/servers/input
  615.         .beginmap
  616.         
  617.         global_mappings
  618.         devstation_mappings
  619.         walk_mappings
  620.         camera_mappings
  621.         guimenu_mappings
  622.  
  623.         .map keyb0:f1.down      "script:ingame_menu"    
  624.         .map joy0:btn2.down     "script:ingame_menu"
  625.     
  626.         .map  keyb0:ctrl.down       firespell
  627.         .map  joy0:btn4.down        firespell
  628.         .map  relmouse0:btn2.down   firespell
  629.  
  630.         .map  keyb0:tab.down        "script:cycle_airplanes" 
  631.         .map  joy0:btn6.down        "script:cycle_airplanes" 
  632.         .map  joy0:btn8.down        "script:cycle_airplanes" 
  633.  
  634.         .endmap
  635.     sel $cwd
  636.    
  637. }
  638.  
  639. #-------------------------------------------------------------------------------
  640. # RUNSTOP   Uebergangs-Zustand
  641. #-------------------------------------------------------------------------------
  642. proc input_runstop {} {
  643.  
  644.     set cwd [psel]
  645.         sel /sys/servers/input
  646.         .beginmap
  647.         global_mappings
  648.         devstation_mappings
  649.         guimenu_mappings
  650.  
  651.         .map keyb0:f1.down      "script:ingame_menu"    
  652.         .map joy0:btn2.down     "script:ingame_menu"
  653.     
  654.         # braucht's zum uebergang
  655.         walk_mappings
  656.  
  657.         .map  keyb0:tab.down        "script:cycle_airplanes" 
  658.         .map  joy0:btn6.down        "script:cycle_airplanes" 
  659.         .map  joy0:btn8.down        "script:cycle_airplanes" 
  660.         
  661.         .endmap
  662.     sel $cwd        
  663. }
  664.  
  665. #-------------------------------------------------------------------------------
  666. #   input im stehen
  667. #-------------------------------------------------------------------------------
  668. proc input_stand {} {
  669.     
  670.     set cwd [psel]
  671.         sel /sys/servers/input
  672.         .beginmap
  673.         
  674.         global_mappings
  675.         devstation_mappings
  676.         walk_mappings
  677.         camera_mappings
  678.         guimenu_mappings
  679.  
  680.         .map keyb0:f1.down      "script:ingame_menu"    
  681.         .map joy0:btn2.down     "script:ingame_menu"
  682.     
  683.         .map  keyb0:ctrl.down       firespell
  684.         .map  joy0:btn4.down        firespell
  685.         .map  relmouse0:btn2.down   firespell    
  686.  
  687.         .map  joy0:btn0.down        "script:switchmode_stand"
  688.         .map  keyb0:return.down     "script:switchmode_stand"
  689.         .map  relmouse0:btn0.down   "script:switchmode_stand"
  690.     
  691.         .map  keyb0:tab.down        "script:cycle_airplanes" 
  692.         .map  joy0:btn6.down        "script:cycle_airplanes" 
  693.         .map  joy0:btn8.down        "script:cycle_airplanes" 
  694.     
  695.         .endmap
  696.     sel $cwd
  697.     
  698. }
  699.  
  700. #-------------------------------------------------------------------------------
  701. # POSSESS
  702. #-------------------------------------------------------------------------------
  703. proc input_possess {} {
  704.  
  705.     set cwd [psel]
  706.         sel /sys/servers/input
  707.         .beginmap
  708.         
  709.         global_mappings
  710.         devstation_mappings
  711.         camera_mappings
  712.         guimenu_mappings
  713.  
  714.         .map keyb0:f1.down      "script:ingame_menu"    
  715.         .map joy0:btn2.down     "script:ingame_menu"
  716.  
  717.         .map  keyb0:return.down     menu_select
  718.         .map  joy0:btn0.down        menu_select
  719.         .map  relmouse0:btn0.down   menu_select
  720.  
  721.         .map  keyb0:esc.down        menu_cancel
  722.         .map  joy0:btn1.down        menu_cancel
  723.         .map  relmouse0:btn1.down   menu_cancel
  724.         .map  relmouse0:btn2.down   menu_cancel
  725.  
  726.         .map  keyb0:right.down      menu_next
  727.         .map  keyb0:d.down          menu_next
  728.         .map  joy0:+abtn.down       menu_next
  729.         .map  joy0:+xbtn.down       menu_next
  730.         .map  relmouse0:-zbtn.down  menu_next
  731.  
  732.         .map  keyb0:left.down       menu_prev
  733.         .map  keyb0:a.down          menu_prev
  734.         .map  joy0:-abtn.down       menu_prev
  735.         .map  joy0:-xbtn.down       menu_prev
  736.         .map  relmouse0:+zbtn.down  menu_prev
  737.  
  738.         .endmap
  739.     sel $cwd
  740.     
  741. }
  742.  
  743. #-------------------------------------------------------------------------------
  744. # POSSESSINGVEHICLE     Steuern eines vehicles
  745. #-------------------------------------------------------------------------------
  746. proc input_possessingvehicle {} {
  747.  
  748.     /game/handler/feedback.registertakencontrol
  749.     set cwd [psel]
  750.         sel /sys/servers/input
  751.         .beginmap
  752.         
  753.         global_mappings
  754.         devstation_mappings
  755.         move_mappings
  756.         camera_mappings
  757.         guimenu_mappings
  758.  
  759.         .map keyb0:f1.down      "script:ingame_menu"    
  760.         .map joy0:btn2.down     "script:ingame_menu"
  761.  
  762.         .map  keyb0:ctrl.pressed        fire
  763.         .map  keyb0:ctrl.up             firestop
  764.         .map  joy0:btn0.pressed         fire
  765.         .map  joy0:btn0.up              firestop
  766.         .map  relmouse0:btn0.pressed    fire
  767.         .map  relmouse0:btn0.up         firestop
  768.  
  769.         .map  keyb0:esc.down            "script:escape_possessingvehicle"
  770.         .map  joy0:btn1.down            "script:escape_possessingvehicle"
  771.         .map  relmouse0:btn2.down       "script:escape_possessingvehicle"
  772.  
  773.         .map  keyb0:space.double        turbomove_forward
  774.         .map  joy0:btn3.double          turbomove_forward
  775.         .map  relmouse0:btn1.double     turbomove_forward
  776.  
  777.         .map  keyb0:tab.down        "script:cycle_airplanes" 
  778.         .map  joy0:btn6.down        "script:cycle_airplanes" 
  779.         .map  joy0:btn8.down        "script:cycle_airplanes" 
  780.  
  781.         .endmap
  782.     sel $cwd
  783. }
  784.  
  785. #-------------------------------------------------------------------------------
  786. # POSSESSINGBUILDING     Steuern eines Gebaeudes
  787. #-------------------------------------------------------------------------------
  788. proc input_possessingbuilding {} {
  789.  
  790.     /game/handler/feedback.registertakencontrol
  791.     set cwd [psel]
  792.         sel /sys/servers/input
  793.         .beginmap
  794.         
  795.         global_mappings
  796.         devstation_mappings
  797.         move_mappings
  798.         guimenu_mappings
  799.  
  800.         .map keyb0:f1.down      "script:ingame_menu"    
  801.         .map joy0:btn2.down     "script:ingame_menu"
  802.  
  803.         .map  keyb0:ctrl.pressed        fire
  804.         .map  keyb0:ctrl.up             firestop
  805.         .map  joy0:btn0.pressed         fire
  806.         .map  joy0:btn0.up              firestop
  807.         .map  relmouse0:btn0.pressed    fire
  808.         .map  relmouse0:btn0.up         firestop
  809.  
  810.         # hoffe mal, das klappt mit getrennt up, down und pressed
  811.         .map  keyb0:return.down     island_toggle
  812.         .map  joy0:btn0.down        island_toggle
  813.         .map  relmouse0:btn0.down   island_toggle
  814.  
  815.         .map  keyb0:esc.down        "script:escape_possessingbuilding"
  816.         .map  joy0:btn1.down        "script:escape_possessingbuilding"
  817.         .map  relmouse0:btn1.down   "script:escape_possessingbuilding"
  818.         .map  relmouse0:btn2.down   "script:escape_possessingbuilding"
  819.  
  820.         .map  keyb0:right.down      searchisland_right
  821.         .map  keyb0:d.down          searchisland_right
  822.         .map  joy0:+xbtn.down       searchisland_right
  823.         .map  joy0:+abtn.down       searchisland_right
  824.         .map  relmouse0:-zbtn.down  searchisland_right
  825.  
  826.         .map  keyb0:left.down       searchisland_left
  827.         .map  keyb0:a.down          searchisland_left
  828.         .map  joy0:-xbtn.down       searchisland_left
  829.         .map  joy0:-abtn.down       searchisland_left
  830.         .map  relmouse0:+zbtn.down  searchisland_left
  831.  
  832.         .map  keyb0:tab.down       "script:cycle_airplanes" 
  833.         .map  joy0:btn6.down        "script:cycle_airplanes" 
  834.         .map  joy0:btn8.down        "script:cycle_airplanes" 
  835.  
  836.         .endmap
  837.     sel $cwd
  838. }
  839.  
  840. #-------------------------------------------------------------------------------
  841. # WALKMENU  Menue offen und muss gesteuert werden
  842. #-------------------------------------------------------------------------------
  843. proc input_walkmenu {} {
  844.  
  845.     #/world.storeinputmapping input_walkmenu
  846.     set cwd [psel]
  847.         sel /sys/servers/input
  848.         .beginmap
  849.         
  850.         global_mappings
  851.         devstation_mappings
  852.         guimenu_mappings
  853.  
  854.         .map keyb0:f1.down      "script:ingame_menu"    
  855.         .map joy0:btn2.down     "script:ingame_menu"
  856.         
  857.         .map  keyb0:f1.down         escape_walkmenu
  858.         .map  joy0:btn5.down        escape_walkmenu
  859.  
  860.         .map  keyb0:esc.down        menu_cancel
  861.         .map  joy0:btn1.down        menu_cancel
  862.         .map  relmouse0:btn1.down   menu_cancel
  863.         .map  relmouse0:btn2.down   menu_cancel
  864.                 
  865.         .map  keyb0:return.down     menu_select
  866.         .map  joy0:btn0.down        menu_select
  867.         .map  relmouse0:btn0.down   menu_select
  868.  
  869.         .map  keyb0:delete.down     menu_throwaway
  870.         .map  keyb0:shift.down      menu_throwaway
  871.         .map  joy0:btn3.down        menu_throwaway
  872.  
  873.         .map  keyb0:right.down      menu_next
  874.         .map  keyb0:d.down          menu_next
  875.         .map  joy0:+xbtn.down       menu_next
  876.         .map  joy0:+abtn.down       menu_next
  877.         .map  relmouse0:-zbtn.down  menu_next
  878.  
  879.         .map  keyb0:left.down       menu_prev
  880.         .map  keyb0:a.down          menu_prev
  881.         .map  joy0:-xbtn.down       menu_prev
  882.         .map  joy0:-abtn.down       menu_prev
  883.         .map  relmouse0:+zbtn.down  menu_prev
  884.  
  885.         .endmap
  886.     sel $cwd   
  887. }
  888.  
  889. #-------------------------------------------------------------------------------
  890. # USEARTEFACTWALK
  891. #-------------------------------------------------------------------------------
  892. proc input_useartefactwalk {} {
  893.  
  894.     set cwd [psel]
  895.         sel /sys/servers/input
  896.         .beginmap
  897.         
  898.         global_mappings
  899.         devstation_mappings
  900.         camera_mappings
  901.         guimenu_mappings
  902.  
  903.         .map keyb0:f1.down      "script:ingame_menu"    
  904.         .map joy0:btn2.down     "script:ingame_menu"
  905.  
  906.         .map  keyb0:f1.down         script:escape_useartefactwalk
  907.         .map  joy0:btn5.down        script:escape_useartefactwalk
  908.  
  909.         .map keyb0:esc.down         menu_cancel
  910.         .map joy0:btn1.down         menu_cancel
  911.         .map  relmouse0:btn1.down   menu_cancel
  912.         .map relmouse0:btn2.down    menu_cancel
  913.  
  914.         .map keyb0:return.down      menu_select
  915.         .map joy0:btn0.down         menu_select
  916.         .map relmouse0:btn0.down    menu_select
  917.  
  918.         .map  keyb0:right.down      turn_right
  919.         .map  keyb0:d.down          turn_right
  920.         .map  joy0:+xbtn.down       turn_right
  921.         .map  joy0:+abtn.down       turn_right
  922.         .map  relmouse0:-zbtn.down  turn_right
  923.  
  924.         .map  keyb0:left.down       turn_left
  925.         .map  keyb0:a.down          turn_left
  926.         .map  joy0:-xbtn.down       turn_left
  927.         .map  joy0:-abtn.down       turn_left
  928.         .map  relmouse0:+zbtn.down  turn_left
  929.  
  930.         .endmap
  931.     sel $cwd    
  932. }
  933.  
  934. #-------------------------------------------------------------------------------
  935. # CREATEBUILDINGWALK
  936. #-------------------------------------------------------------------------------
  937. proc input_createbuildingwalk {} {
  938.  
  939.     set cwd [psel]
  940.         sel /sys/servers/input
  941.         .beginmap
  942.         global_mappings
  943.         devstation_mappings
  944.         guimenu_mappings
  945.  
  946.         .map keyb0:f1.down      "script:ingame_menu"    
  947.         .map joy0:btn2.down     "script:ingame_menu"
  948.  
  949.         .endmap
  950.     sel $cwd       
  951. }
  952.  
  953. #-------------------------------------------------------------------------------
  954. # TRADEMENUWALK
  955. #-------------------------------------------------------------------------------
  956. proc input_trademenuwalk {} {
  957.  
  958.     set cwd [psel]
  959.         sel /sys/servers/input
  960.         .beginmap
  961.         
  962.         global_mappings
  963.         devstation_mappings
  964.         guimenu_mappings
  965.         trade_mappings
  966.  
  967.         .map keyb0:f1.down      "script:ingame_menu"    
  968.         .map joy0:btn2.down     "script:ingame_menu"
  969.  
  970.         .endmap
  971.     sel $cwd
  972. }
  973.  
  974. #-------------------------------------------------------------------------------
  975. # STORAGEMENUWALK
  976. #-------------------------------------------------------------------------------
  977. proc input_storagemenuwalk {} {
  978.     set cwd [psel]
  979.         sel /sys/servers/input
  980.         .beginmap
  981.         
  982.         global_mappings
  983.         devstation_mappings
  984.         guimenu_mappings
  985.         trade_mappings
  986.  
  987.         .map keyb0:f1.down      "script:ingame_menu"    
  988.         .map joy0:btn2.down     "script:ingame_menu"
  989.  
  990.         .endmap
  991.     sel $cwd   
  992. }
  993.  
  994. #-------------------------------------------------------------------------------
  995. # TRANSFORMMENUWALK
  996. #-------------------------------------------------------------------------------
  997. proc input_transformmenuwalk {} {
  998.     set cwd [psel]
  999.         sel /sys/servers/input
  1000.         .beginmap
  1001.         
  1002.         global_mappings
  1003.         devstation_mappings
  1004.         guimenu_mappings
  1005.         trade_mappings
  1006.  
  1007.         .map keyb0:f1.down      "script:ingame_menu"    
  1008.         .map joy0:btn2.down     "script:ingame_menu"
  1009.  
  1010.         .endmap
  1011.     sel $cwd  
  1012. }
  1013.  
  1014. #-------------------------------------------------------------------------------
  1015. # CRASH
  1016. #-------------------------------------------------------------------------------
  1017. proc input_crash {} {
  1018.     set cwd [psel]
  1019.         sel /sys/servers/input
  1020.         .beginmap
  1021.         global_mappings
  1022.         devstation_mappings
  1023.         guimenu_mappings
  1024.  
  1025.         .map keyb0:f1.down      "script:ingame_menu"    
  1026.         .map joy0:btn2.down     "script:ingame_menu"
  1027.  
  1028.         # fuer "Weiterfliegen"
  1029.         move_mappings
  1030.         
  1031.         .endmap
  1032.     sel $cwd       
  1033. }
  1034.  
  1035. #-------------------------------------------------------------------------------
  1036. # TUTORIALSTART
  1037. #-------------------------------------------------------------------------------
  1038. proc input_tutorialstart {} {
  1039.     set cwd [psel]
  1040.         sel /sys/servers/input
  1041.         .beginmap
  1042.         global_mappings
  1043.         devstation_mappings
  1044.         .endmap
  1045.     sel $cwd       
  1046. }
  1047.  
  1048. #-------------------------------------------------------------------------------
  1049. # TURBO
  1050. #-------------------------------------------------------------------------------
  1051. proc input_turbo {} {
  1052.     set cwd [psel]
  1053.         sel /sys/servers/input
  1054.         .beginmap
  1055.         global_mappings
  1056.         devstation_mappings
  1057.         guimenu_mappings
  1058.  
  1059.         .map keyb0:f1.down      "script:ingame_menu"    
  1060.         .map joy0:btn2.down     "script:ingame_menu"
  1061.  
  1062.         .map  keyb0:ctrl.up         "script:resetboost"
  1063.         .map  joy0:btn3.up          "script:resetboost"
  1064.  
  1065.         .endmap
  1066.     sel $cwd       
  1067. }
  1068.  
  1069. #-------------------------------------------------------------------------------
  1070. # JUMP from run
  1071. #-------------------------------------------------------------------------------
  1072. proc input_jumprun {} {
  1073.     set cwd [psel]
  1074.         sel /sys/servers/input
  1075.         .beginmap
  1076.         global_mappings
  1077.         devstation_mappings
  1078.         guimenu_mappings
  1079.  
  1080.         .map keyb0:f1.down      "script:ingame_menu"    
  1081.         .map joy0:btn2.down     "script:ingame_menu"
  1082.  
  1083.         # walkmappings fuers weiterlaufen
  1084.         walk_mappings
  1085.         .map  joy0:btn3.pressed         move_forward
  1086.         .map  relmouse0:btn1.pressed    move_forward
  1087.  
  1088.         .endmap
  1089.     sel $cwd       
  1090. }
  1091.  
  1092. #-------------------------------------------------------------------------------
  1093. # JUMP from stand
  1094. #-------------------------------------------------------------------------------
  1095. proc input_jumpstand {} {
  1096.     set cwd [psel]
  1097.         sel /sys/servers/input
  1098.         .beginmap
  1099.         global_mappings
  1100.         devstation_mappings
  1101.         guimenu_mappings
  1102.  
  1103.         .map keyb0:f1.down      "script:ingame_menu"    
  1104.         .map joy0:btn2.down     "script:ingame_menu"
  1105.  
  1106.         # fuers weiterlaufen
  1107.         walk_mappings
  1108.         .map  joy0:btn3.pressed         move_forward
  1109.         .map  relmouse0:btn1.pressed    move_forward
  1110.         
  1111.         .endmap
  1112.     sel $cwd       
  1113. }
  1114.  
  1115. #-------------------------------------------------------------------------------
  1116. # FALLING
  1117. #-------------------------------------------------------------------------------
  1118. proc input_falling {} {
  1119.     set cwd [psel]
  1120.         sel /sys/servers/input
  1121.         .beginmap
  1122.         global_mappings
  1123.         devstation_mappings
  1124.         guimenu_mappings
  1125.  
  1126.         .map keyb0:f1.down      "script:ingame_menu"    
  1127.         .map joy0:btn2.down     "script:ingame_menu"
  1128.  
  1129.         # fuers weiterlaufen
  1130.         walk_mappings
  1131.  
  1132.         .endmap
  1133.     sel $cwd        
  1134. }
  1135.  
  1136. #-------------------------------------------------------------------------------
  1137. # CINEMATIC
  1138. #-------------------------------------------------------------------------------
  1139. proc input_cinematic {} {
  1140.     set cwd [psel]
  1141.         sel /sys/servers/input
  1142.         .beginmap
  1143.         global_mappings
  1144.         devstation_mappings
  1145.         camera_mappings
  1146.         guimenu_mappings
  1147.         .endmap
  1148.     sel $cwd    
  1149. }
  1150.  
  1151. # ---
  1152. # EOF
  1153.